﻿using UnityEngine;

namespace CornerMemo
{
    /// <summary>
    /// 键盘按住事件参数。
    /// </summary>
    public class KeyboardHoldEventArgs : GameEventArgs
    {
        public static readonly int EventId = typeof(KeyboardHoldEventArgs).GetHashCode();
        public override int Id => EventId;

        /// <summary>
        /// 抬起的按键。
        /// </summary>
        public KeyCode KeyCode { get; private set; }
        ///<summary>
        /// 获取用户自定义数据。
        ///</summary>
        public object UserData { get; private set; }

        public static KeyboardHoldEventArgs Create(object userData = null)
        {
            var args = ReferencePool.Acquire<KeyboardHoldEventArgs>();
            args.UserData = userData;
            return args;
        }

        public override void Clear()
        {
            this.UserData = null;
        }

        
    }
}